package com.zhoupu.mqtt.core.gateway;

import com.zhoupu.mqtt.core.customerconst.ChannelName;
import org.springframework.integration.annotation.MessagingGateway;
import org.springframework.integration.mqtt.support.MqttHeaders;
import org.springframework.messaging.handler.annotation.Header;

/**
 * MQTT 网关-消息发布入口
 *
 * @author Zhouyongli
 * @version 2024/09/12 14:23
 **/

@MessagingGateway(defaultRequestChannel = ChannelName.MQTT_OUTBOUND_CHANNEL)
public interface MQTTGateway {
    void sendToMQTT(@Header(MqttHeaders.TOPIC) String topic, String payload);

    void sendToMQTT(@Header(MqttHeaders.TOPIC) String topic, @Header(MqttHeaders.QOS) int qos, String payload);
}
